Skip to content

[Android] Restore OnBackButtonPressed interception support when using OnBackPressedDispatcher #35154

Open
Dhivya-SF4094 wants to merge 10 commits into
dotnet:inflight/currentfrom
Dhivya-SF4094:fix-8680
Open

[Android] Restore OnBackButtonPressed interception support when using OnBackPressedDispatcher #35154
Dhivya-SF4094 wants to merge 10 commits into
dotnet:inflight/currentfrom
Dhivya-SF4094:fix-8680

Conversation

@Dhivya-SF4094
Copy link
Copy Markdown
Contributor

@Dhivya-SF4094 Dhivya-SF4094 commented Apr 27, 2026

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description

Fixes #8680

Replaces the deprecated OnBackPressed() override and the API 33+-only PredictiveBackCallback (registered via native OnBackInvokedDispatcher) with a single unified MauiOnBackPressedCallback registered on AndroidX OnBackPressedDispatcher.

What this fixes:

  • Eliminates the dual-fire bug on API 33+ where both OnBackPressed() and PredictiveBackCallback could fire
  • Unifies back navigation into a single AndroidX path for all API levels (21+)
  • Removes manual OnDestroy cleanup — AddCallback(LifecycleOwner, callback) is lifecycle-aware

What this does NOT change:

  • The system-rendered predictive back preview (OS swipe animation) continues to work on API 33+ as before
  • Gesture-progress hooks (onBackStarted/onBackProgressed/onBackCancelled) are not surfaced to MAUI lifecycle — this was also the case before and could be a future enhancement

Changes

  • MauiAppCompatActivity.cs — Added MauiOnBackPressedCallback : OnBackPressedCallback registered in OnCreate; removed PredictiveBackCallback, using Android.Window, and using System
  • MauiAppCompatActivity.Lifecycle.cs — Removed deprecated OnBackPressed() override; changed HandleBackNavigation() from void to internal bool

Key Design Decisions

  • Remove OnBackPressed() override? AppCompatActivity.OnBackPressed() internally calls OnBackPressedDispatcher.OnBackPressed() anyway. Once callbacks are registered with the dispatcher, the override is redundant and was creating a dual-path risk on API 33+.
  • try/finally around the dispatcher call? When MAUI doesn't handle back, the callback temporarily disables itself and re-invokes the dispatcher, then re-enables in finally. Without finally, an exception would leave Enabled = false permanently.
  • No manual OnDestroy cleanup? AddCallback(LifecycleOwner, callback) is lifecycle-aware — AndroidX removes the callback automatically at DESTROYED.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Apr 27, 2026
@Dhivya-SF4094 Dhivya-SF4094 changed the base branch from main to net11.0 April 27, 2026 12:39
@Dhivya-SF4094 Dhivya-SF4094 changed the title Fix 8680 [Android] Restore OnBackButtonPressed interception support when using OnBackPressedDispatcher Apr 27, 2026
@Dhivya-SF4094 Dhivya-SF4094 changed the title [Android] Restore OnBackButtonPressed interception support when using OnBackPressedDispatcher [WIP] Android: Restore OnBackButtonPressed interception support when using OnBackPressedDispatcher Apr 27, 2026
@Dhivya-SF4094 Dhivya-SF4094 changed the title [WIP] Android: Restore OnBackButtonPressed interception support when using OnBackPressedDispatcher [Android] Restore OnBackButtonPressed interception support when using OnBackPressedDispatcher Apr 28, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review April 28, 2026 13:25
Copilot AI review requested due to automatic review settings April 28, 2026 13:25
@sheiksyedm sheiksyedm added the community ✨ Community Contribution label Apr 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Android back navigation handling in MauiAppCompatActivity to restore reliable OnBackButtonPressed interception when using AndroidX OnBackPressedDispatcher, avoiding deprecated/dual-path back handling and adding a regression UI test.

Changes:

  • Register a single AndroidX OnBackPressedCallback (all API levels) and route back handling through MAUI lifecycle events.
  • Remove the deprecated OnBackPressed() override and adjust HandleBackNavigation() to return whether MAUI handled the back press.
  • Add Issue #8680 HostApp page + UI test, and adjust Shell toolbar back handling to use Shell’s back-press pipeline.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt Records removal of OnBackPressed/OnDestroy overrides from the public API surface (but introduces a BOM inconsistency).
src/Core/src/Platform/Android/MauiAppCompatActivity.cs Registers MauiOnBackPressedCallback on OnBackPressedDispatcher and removes predictive-back callback plumbing.
src/Core/src/Platform/Android/MauiAppCompatActivity.Lifecycle.cs Removes OnBackPressed() override and changes HandleBackNavigation() to return a boolean.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8680.cs Adds a regression UI test for intercepting back navigation (but currently gated incorrectly and doesn’t simulate device back).
src/Controls/tests/TestCases.HostApp/Issues/Issue8680.cs Adds the HostApp reproduction page for Issue #8680 (needs formatting cleanup).
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cs Routes toolbar back through _shell.SendBackButtonPressed() instead of the current Page directly.

Comment thread src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8680.cs Outdated
Comment thread src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8680.cs Outdated
Comment thread src/Controls/tests/TestCases.HostApp/Issues/Issue8680.cs
Comment thread src/Controls/tests/TestCases.HostApp/Issues/Issue8680.cs
Comment thread src/Core/src/Platform/Android/MauiAppCompatActivity.cs Outdated
Comment thread src/Core/src/Platform/Android/MauiAppCompatActivity.Lifecycle.cs Outdated
Comment thread src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt Outdated
Copy link
Copy Markdown
Collaborator

@MauiBot MauiBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 7 findings

See inline comments for details.

@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Apr 28, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 29, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 29, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 29, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 29, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 29, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 29, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 29, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 29, 2026
@MauiBot MauiBot added s/agent-review-incomplete and removed s/agent-changes-requested AI agent recommends changes - found a better alternative or issues labels Apr 29, 2026
@dotnet dotnet deleted a comment from github-actions Bot Apr 29, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 29, 2026
Copy link
Copy Markdown
Collaborator

@MauiBot MauiBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 6 findings

See inline comments for details.

Comment thread src/Controls/tests/TestCases.HostApp/Issues/Issue8680.cs
Comment thread src/Core/src/Platform/Android/MauiAppCompatActivity.Lifecycle.cs Outdated
Comment thread src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8680.cs
Comment thread src/Core/src/Platform/Android/MauiAppCompatActivity.cs Outdated
@kubaflo
Copy link
Copy Markdown
Contributor

kubaflo commented Jun 2, 2026

Test Failure Review

@Dhivya-SF4094 - new test-failure review results are available based on this last commit: a42e2f9.
To request a fresh review after new comments, commits, or CI runs, comment /review tests.

Overall Insufficient data Failures 3 Data Partial Platform android+multi

Test Failure Review - a42e2f9 - [Android] Restore OnBackButtonPressed interception support when using OnBackPressedDispatcher - 2026-06-02 13:14 UTC

Overall verdict: Insufficient data

The gathered context shows failing Build Analysis, maui-pr-devicetests, and maui-pr-uitests checks, but both referenced AzDO builds returned 404 and no failed records, logs, test results, or Helix summaries were available. The PR scope is Android navigation and includes Android platform code plus Issue8680 UI tests, so the Android device/UI failures cannot be responsibly attributed or dismissed without the missing build evidence.

Failure Verdict Evidence
Build Analysis Insufficient data The check is marked failed, but the context provides only the Build Analysis documentation link and no build-analysis matches, timeline issues, or log excerpts.
maui-pr-devicetests build 1428613 Insufficient data The rollup and Android CoreCLR, Android Mono, MacCatalyst Mono, Windows device-test build, and iOS Mono child checks failed, but build 1428613 was inaccessible with 404 (Not Found); failedRecords, logExcerpts, testResults, and Helix summaries are empty, so hidden device-test failures could not be verified.
maui-pr-uitests build 1428612 Insufficient data The rollup and sample-app build child checks failed, but build 1428612 was inaccessible with 404 (Not Found); no timeline records, logs, test results, or distinct extracted failures were available.

Recommended action

Regather the review context when builds 1428612 and 1428613 are accessible, then inspect the failed timelines/logs and Helix aggregate data before attributing these failures to the PR.

Evidence details

PR #35154 targets inflight/current from fix-8680 at a42e2f99997da32392b4bc9c76a8e8c9c29ddc7a. Labels and scope point to platform/android and area-navigation; inferred platform from changed files is android.

Changed files are src/Core/src/Platform/Android/MauiAppCompatActivity.Lifecycle.cs, src/Core/src/Platform/Android/MauiAppCompatActivity.cs, src/Controls/tests/TestCases.HostApp/Issues/Issue8680.cs, and src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8680.cs.

The gathered check rollup marks maui-pr build 1420508 successful. The failing or inconclusive checks are Build Analysis, maui-pr-devicetests, device-test child checks for Android CoreCLR, Android Mono, MacCatalyst Mono, Windows device-test build, iOS Mono, maui-pr-uitests, and UI sample-app build child checks.

Build 1428613 and build 1428612 both have accessible: false with error Response status code does not indicate success: 404 (Not Found). For both builds, failedRecords, timelineIssues, logExcerpts, testFailuresFromLogs, testResults, and recentBaseBuilds are empty. For device-test build 1428613, helix.checked is false, helix.jobIds is empty, and helix.summaries is empty.

No distinct test failures were extracted from accessible AzDO logs or test results. The context limitation notes that authenticated AzDO access used an Azure CLI bearer token for local-only data gathering, while the gh-aw workflow relies on public build/timeline/log APIs unless AZDO_TOKEN is provided by the runner environment.

KarthikRajaKalaimani and others added 8 commits June 5, 2026 15:10
…net#34527)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details:

Horizontalspacing / Verticalspacing is not not applied to the first
column in GridItemLayout using CollectionView on Android platform.
        
### Root Cause:

The grid spacing was not being distributed symmetrically across the
active layout implementations, so edge items did not fully participate
when spacing changed at runtime.

### Description of Change:

- On Android, the fix in MauiRecyclerView.cs changes how RecyclerView
padding is handled for GridItemsLayout. Android was already using
SpacingItemDecoration, which applies half-spacing on all four sides of
each item. Previously, negative RecyclerView padding canceled that
spacing at the control edges. The branch keeps that negative-padding
behavior for non-grid layouts, but disables it for GridItemsLayout,
allowing the grid’s half-spacing to remain visible at the outer
perimeter. This makes the first row and first column visually respond
when spacing changes, but it also changes the grid behavior from spacing
only between items to spacing around the outside edges as well.

**Tested the behavior in the following platforms:**

- [x] Android
- [x] Windows
- [ ] iOS
- [ ] Mac

### Reference:

N/A

### Issues Fixed:

Fixes  dotnet#34257      

### Screenshots
| Before  | After  |
|---------|--------|
| <Video
src="https://github.com/user-attachments/assets/578dda69-1d60-474c-a6d8-23b3f9d29a50"
Width="300" Height="600"> | <Video
src="https://github.com/user-attachments/assets/7f3826e6-5922-4b6f-a6b9-de581b7db6c3"
Width="300" Height="600"> |
…ing ToPlatform and subsequent property changes (dotnet#31159)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

- The iOS Label performance was improved in PR dotnet#30864. In that PR, the
Label and Entry Feature Matrix test sample and script were modified,
which caused discrepancies in the expected images due to changes which
is due to test sample's default property values. In this PR, I updated
the test sample and re-saved the images accordingly.

- Windows - The Entry is now unfocused, so I re-saved the latest image.
- Android - I modified the test sample by altering the default values
and re-saved two images.

Additionally, while working on the test sample changes, I identified and
fixed issues in FormattedStringExtensions.

These updates improve formatted text rendering on iOS by correctly
propagating span properties (font, character spacing, and line-break
settings) from the label to each span. The layout logic is also more
robust, falling back to MAUI’s calculated size when iOS has not yet
provided a valid label size, preventing incorrect text positioning and
rendering issues.

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Contributing to dotnet#30864

---------

Co-authored-by: KarthikRajaKalaimani <92777139+KarthikRajaKalaimani@users.noreply.github.com>
Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: albyrock87 <albyrock87@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Appears to be unused, but trips up analyzers when investigating other
issues.

Fixes: xamarin/Xamarin.Forms#1749

---------
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

🔍 Skill Validation Results

✅ Static Checks Passed

Skills checked: 18 | Agents checked: 4

Full validator output
Found 18 skill(s)
[pr-review] 📊 pr-review: 3,365 BPE tokens [chars/4: 3,261] (standard ~), 22 sections, 7 code blocks
[pr-review]    ⚠  Skill is 3,365 BPE tokens (chars/4 estimate: 3,261) — approaching "comprehensive" range where gains diminish.
[try-fix] 📊 try-fix: 6,916 BPE tokens [chars/4: 7,049] (comprehensive ✗), 45 sections, 17 code blocks
[try-fix]    ⚠  Skill is 6,916 BPE tokens (chars/4 estimate: 7,049) — "comprehensive" skills hurt performance by 2.9pp on average. Consider splitting into 2–3 focused skills.
[write-xaml-tests] 📊 write-xaml-tests: 755 BPE tokens [chars/4: 742] (detailed ✓), 13 sections, 3 code blocks
[write-xaml-tests]    ⚠  No numbered workflow steps — agents follow sequenced procedures more reliably.
[issue-triage] 📊 issue-triage: 2,035 BPE tokens [chars/4: 1,932] (detailed ✓), 31 sections, 8 code blocks
[pr-finalize] 📊 pr-finalize: 2,906 BPE tokens [chars/4: 3,073] (standard ~), 61 sections, 11 code blocks
[pr-finalize]    ⚠  Skill is 2,906 BPE tokens (chars/4 estimate: 3,073) — approaching "comprehensive" range where gains diminish.
[evaluate-pr-tests] 📊 evaluate-pr-tests: 2,955 BPE tokens [chars/4: 2,949] (standard ~), 35 sections, 6 code blocks
[evaluate-pr-tests]    ⚠  Skill is 2,955 BPE tokens (chars/4 estimate: 2,949) — approaching "comprehensive" range where gains diminish.
[dependency-flow] 📊 dependency-flow: 2,620 BPE tokens [chars/4: 2,528] (standard ~), 33 sections, 5 code blocks
[dependency-flow]    ⚠  Skill is 2,620 BPE tokens (chars/4 estimate: 2,528) — approaching "comprehensive" range where gains diminish.
[agentic-labeler] 📊 agentic-labeler: 2,839 BPE tokens [chars/4: 2,788] (standard ~), 8 sections, 0 code blocks
[agentic-labeler]    ⚠  Skill is 2,839 BPE tokens (chars/4 estimate: 2,788) — approaching "comprehensive" range where gains diminish.
[agentic-labeler]    ⚠  No code blocks — agents perform better with concrete snippets and commands.
[code-review] 📊 code-review: 2,327 BPE tokens [chars/4: 2,361] (detailed ✓), 27 sections, 8 code blocks
[azdo-build-investigator] 📊 azdo-build-investigator: 1,676 BPE tokens [chars/4: 1,599] (detailed ✓), 9 sections, 3 code blocks
[azdo-build-investigator]    ⚠  No numbered workflow steps — agents follow sequenced procedures more reliably.
[write-ui-tests] 📊 write-ui-tests: 2,877 BPE tokens [chars/4: 2,965] (standard ~), 27 sections, 13 code blocks
[write-ui-tests]    ⚠  Skill is 2,877 BPE tokens (chars/4 estimate: 2,965) — approaching "comprehensive" range where gains diminish.
[find-regression-risk] 📊 find-regression-risk: 967 BPE tokens [chars/4: 905] (detailed ✓), 10 sections, 2 code blocks
[find-regression-risk]    ⚠  No YAML frontmatter — agents use name/description for skill discovery.
[find-reviewable-pr] 📊 find-reviewable-pr: 1,778 BPE tokens [chars/4: 1,722] (detailed ✓), 22 sections, 3 code blocks
[run-helix-tests] 📊 run-helix-tests: 1,446 BPE tokens [chars/4: 1,362] (detailed ✓), 27 sections, 11 code blocks
[run-integration-tests] 📊 run-integration-tests: 2,028 BPE tokens [chars/4: 2,052] (detailed ✓), 35 sections, 7 code blocks
[learn-from-pr] 📊 learn-from-pr: 2,192 BPE tokens [chars/4: 2,463] (detailed ✓), 26 sections, 3 code blocks
[verify-tests-fail-without-fix] 📊 verify-tests-fail-without-fix: 2,271 BPE tokens [chars/4: 2,189] (detailed ✓), 26 sections, 7 code blocks
[run-device-tests] 📊 run-device-tests: 2,969 BPE tokens [chars/4: 2,992] (standard ~), 53 sections, 8 code blocks
[run-device-tests]    ⚠  Skill is 2,969 BPE tokens (chars/4 estimate: 2,992) — approaching "comprehensive" range where gains diminish.
✅ All checks passed (18 skill(s))
Found 4 agent(s)
Validated 4 agent(s)

✅ All checks passed (4 agent(s))

⏭️ LLM Evaluation: Skipped

No changed skills with eval tests found.

🔍 Full results and investigation steps

@kubaflo
Copy link
Copy Markdown
Contributor

kubaflo commented Jun 5, 2026

/review -b feature/enhanced-reviewer

Copy link
Copy Markdown
Collaborator

@MauiBot MauiBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review Summary

@Dhivya-SF4094 — new AI review results are available based on this last commit: b8e4f6c.
Reverted script file changes To request a fresh review after new comments or commits, comment /review rerun.

Gate Failed Code Review Needs Changes Confidence High Platform Android

Review Sessions — click to expand
Gate — Test Before & After Fix

Gate Result: ❌ FAILED

Platform: ANDROID · Base: main · Merge base: e904e900

🩺 Fix does not compile — applying the PR's fix produces a build error before tests can run. The earlier-than-test failure is the root cause; the per-test ❌ FAIL marks are downstream effects, not real test failures.

Test Without Fix (expect FAIL) With Fix (expect PASS)
🖥️ Issue8680 Issue8680 🛠️ BUILD ERROR 🛠️ BUILD ERROR
🔴 Without fix — 🖥️ Issue8680: 🛠️ BUILD ERROR · 1298s
  Determining projects to restore...
  Restored /home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 528 ms).
  Restored /home/vsts/work/1/s/src/Essentials/src/Essentials.csproj (in 4.05 sec).
  Restored /home/vsts/work/1/s/src/Core/src/Core.csproj (in 5.74 sec).
  Restored /home/vsts/work/1/s/src/Core/maps/src/Maps.csproj (in 2.87 sec).
  Restored /home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj (in 79 ms).
  Restored /home/vsts/work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 67 ms).
  Restored /home/vsts/work/1/s/src/Controls/Maps/src/Controls.Maps.csproj (in 54 ms).
  Restored /home/vsts/work/1/s/src/Controls/Foldable/src/Controls.Foldable.csproj (in 620 ms).
  Restored /home/vsts/work/1/s/src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 71 ms).
  Restored /home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj (in 1.83 sec).
  1 of 11 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(48,21): error CS1061: 'ScrollView' does not contain a definition for 'Row' and no accessible extension method 'Row' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]

Build FAILED.

/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(48,21): error CS1061: 'ScrollView' does not contain a definition for 'Row' and no accessible extension method 'Row' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
    0 Warning(s)
    2 Error(s)

Time Elapsed 00:06:23.21
* daemon not running; starting now at tcp:5037
* daemon started successfully
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(48,21): error CS1061: 'ScrollView' does not contain a definition for 'Row' and no accessible extension method 'Row' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]

Build FAILED.

/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(48,21): error CS1061: 'ScrollView' does not contain a definition for 'Row' and no accessible extension method 'Row' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
    0 Warning(s)
    2 Error(s)

Time Elapsed 00:06:48.60
* daemon not running; starting now at tcp:5037
* daemon started successfully
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(48,21): error CS1061: 'ScrollView' does not contain a definition for 'Row' and no accessible extension method 'Row' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]

Build FAILED.

/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(48,21): error CS1061: 'ScrollView' does not contain a definition for 'Row' and no accessible extension method 'Row' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
    0 Warning(s)
    2 Error(s)

Time Elapsed 00:06:37.01

🟢 With fix — 🖥️ Issue8680: 🛠️ BUILD ERROR · 379s
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
/home/vsts/work/1/s/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt(2517,1): error RS0017: Symbol 'override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/home/vsts/work/1/s/src/Core/src/Core.csproj::TargetFramework=net10.0-android36.0]

Build FAILED.

/home/vsts/work/1/s/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt(2517,1): error RS0017: Symbol 'override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/home/vsts/work/1/s/src/Core/src/Core.csproj::TargetFramework=net10.0-android36.0]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:01:39.36
* daemon not running; starting now at tcp:5037
* daemon started successfully
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
/home/vsts/work/1/s/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt(2517,1): error RS0017: Symbol 'override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/home/vsts/work/1/s/src/Core/src/Core.csproj::TargetFramework=net10.0-android36.0]

Build FAILED.

/home/vsts/work/1/s/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt(2517,1): error RS0017: Symbol 'override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/home/vsts/work/1/s/src/Core/src/Core.csproj::TargetFramework=net10.0-android36.0]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:01:40.74
* daemon not running; starting now at tcp:5037
* daemon started successfully
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
/home/vsts/work/1/s/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt(2517,1): error RS0017: Symbol 'override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/home/vsts/work/1/s/src/Core/src/Core.csproj::TargetFramework=net10.0-android36.0]

Build FAILED.

/home/vsts/work/1/s/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt(2517,1): error RS0017: Symbol 'override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/home/vsts/work/1/s/src/Core/src/Core.csproj::TargetFramework=net10.0-android36.0]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:01:15.80

⚠️ Failure Details

  • 🛠️ Issue8680 without fix: build failed before tests could run
    • /home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accept...
  • 🛠️ Issue8680 with fix: build failed (fix does not compile)
📁 Fix files reverted (264 files)
  • eng/Signing.props
  • eng/Versions.props
  • eng/devices/run-windows-devicetests.cmd
  • eng/devices/windows.cake
  • eng/pipelines/ci-copilot.yml
  • eng/pipelines/common/ui-tests-steps.yml
  • eng/pipelines/common/ui-tests.yml
  • src/BlazorWebView/src/Maui/Android/BlazorAndroidWebView.cs
  • src/BlazorWebView/src/Maui/Android/BlazorWebViewHandler.Android.cs
  • src/BlazorWebView/src/Maui/Android/WebKitWebViewClient.cs
  • src/Compatibility/Core/src/Android/CollectionView/TemplatedItemViewHolder.cs
  • src/Compatibility/Core/src/Android/Renderers/SwipeViewRenderer.cs
  • src/Compatibility/Core/src/MacOS/Extensions/NSMenuExtensions.cs
  • src/Compatibility/Core/src/Windows/CollectionView/ItemContentControl.cs
  • src/Compatibility/Core/src/iOS/CollectionView/TemplatedCell.cs
  • src/Compatibility/Core/src/iOS/EventTracker.cs
  • src/Compatibility/Core/src/iOS/Renderers/SwipeViewRenderer.cs
  • src/Compatibility/Core/src/iOS/Renderers/UIContainerCell.cs
  • src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs
  • src/Controls/src/Core/ActionSheetArguments.cs
  • src/Controls/src/Core/AlertArguments.cs
  • src/Controls/src/Core/BindableObject.cs
  • src/Controls/src/Core/Border/Border.cs
  • src/Controls/src/Core/Button/Button.iOS.cs
  • src/Controls/src/Core/Compatibility/Android/Resources/layout/flyoutcontent.axml
  • src/Controls/src/Core/Compatibility/Handlers/FlyoutPage/iOS/PhoneFlyoutPageRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/SearchHandlerAppearanceTracker.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRecyclerAdapter.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutTemplatedContentRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFragmentStateAdapter.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellSectionRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRootRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/UIContainerCell.cs
  • src/Controls/src/Core/Compatibility/Handlers/TabbedPage/iOS/TabbedRenderer.cs
  • src/Controls/src/Core/ContentPage/ContentPage.cs
  • src/Controls/src/Core/ContentView/ContentView.cs
  • src/Controls/src/Core/Editor/Editor.Mapper.cs
  • src/Controls/src/Core/Editor/Editor.iOS.cs
  • src/Controls/src/Core/Element/Element.cs
  • src/Controls/src/Core/Entry/Entry.Mapper.cs
  • src/Controls/src/Core/Entry/Entry.iOS.cs
  • src/Controls/src/Core/FlyoutPage/FlyoutPage.cs
  • src/Controls/src/Core/FormattedString.cs
  • src/Controls/src/Core/GestureElement.cs
  • src/Controls/src/Core/Handlers/Items/Android/Adapters/EmptyViewAdapter.cs
  • src/Controls/src/Core/Handlers/Items/Android/Adapters/GroupableItemsViewAdapter.cs
  • src/Controls/src/Core/Handlers/Items/Android/Adapters/ItemsViewAdapter.cs
  • src/Controls/src/Core/Handlers/Items/Android/ItemContentView.cs
  • src/Controls/src/Core/Handlers/Items/Android/MauiCarouselRecyclerView.cs
  • src/Controls/src/Core/Handlers/Items/Android/MauiRecyclerView.cs
  • src/Controls/src/Core/Handlers/Items/Android/SimpleViewHolder.cs
  • src/Controls/src/Core/Handlers/Items/Android/SizedItemContentView.cs
  • src/Controls/src/Core/Handlers/Items/Android/TemplatedItemViewHolder.cs
  • src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Android.cs
  • src/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cs
  • src/Controls/src/Core/Handlers/Items/CarouselViewHandler.cs
  • src/Controls/src/Core/Handlers/Items/ItemsViewHandler.cs
  • src/Controls/src/Core/Handlers/Items/ItemsViewHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.Android.cs
  • src/Controls/src/Core/Handlers/Items/Tizen/ItemTemplateAdaptor.cs
  • src/Controls/src/Core/Handlers/Items/iOS/CarouselViewController.cs
  • src/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cs
  • src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs
  • src/Controls/src/Core/Handlers/Items/iOS/TemplatedCell.cs
  • src/Controls/src/Core/Handlers/Items2/CarouselViewHandler2.iOS.cs
  • src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs
  • src/Controls/src/Core/Handlers/Items2/iOS/CarouselViewController2.cs
  • src/Controls/src/Core/Handlers/Items2/iOS/GroupableItemsViewController2.cs
  • src/Controls/src/Core/Handlers/Items2/iOS/ItemsViewController2.cs
  • src/Controls/src/Core/Handlers/Items2/iOS/LayoutFactory2.cs
  • src/Controls/src/Core/Handlers/Items2/iOS/SelectableItemsViewController2.cs
  • src/Controls/src/Core/Handlers/Items2/iOS/StructuredItemsViewController2.cs
  • src/Controls/src/Core/Handlers/Items2/iOS/TemplatedCell2.cs
  • src/Controls/src/Core/Handlers/Shapes/Polygon/PolygonHandler.Android.cs
  • src/Controls/src/Core/Handlers/Shapes/Polygon/PolygonHandler.Tizen.cs
  • src/Controls/src/Core/Handlers/Shapes/Polygon/PolygonHandler.Windows.cs
  • src/Controls/src/Core/Handlers/Shapes/Polygon/PolygonHandler.cs
  • src/Controls/src/Core/Handlers/Shapes/Polygon/PolygonHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Shapes/Polyline/PolylineHandler.Android.cs
  • src/Controls/src/Core/Handlers/Shapes/Polyline/PolylineHandler.Tizen.cs
  • src/Controls/src/Core/Handlers/Shapes/Polyline/PolylineHandler.Windows.cs
  • src/Controls/src/Core/Handlers/Shapes/Polyline/PolylineHandler.cs
  • src/Controls/src/Core/Handlers/Shapes/Polyline/PolylineHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Shell/ShellHandler.Windows.cs
  • src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
  • src/Controls/src/Core/Handlers/Shell/ShellSectionHandler.Windows.cs
  • src/Controls/src/Core/Handlers/Shell/Windows/ShellFlyoutItemView.cs
  • src/Controls/src/Core/Handlers/Shell/Windows/ShellView.cs
  • src/Controls/src/Core/Hosting/AppHostBuilderExtensions.cs
  • src/Controls/src/Core/ImageElement.cs
  • src/Controls/src/Core/IndicatorView/IndicatorStackLayout.cs
  • src/Controls/src/Core/InputView/InputView.cs
  • src/Controls/src/Core/Internals/WeakEventProxy.cs
  • src/Controls/src/Core/Items/SelectionList.cs
  • src/Controls/src/Core/Label/Label.Mapper.cs
  • src/Controls/src/Core/Label/Label.cs
  • src/Controls/src/Core/Label/Label.iOS.cs
  • src/Controls/src/Core/Layout/Layout.cs
  • src/Controls/src/Core/ListView/ListView.cs
  • src/Controls/src/Core/NavigationPage/NavigationPage.cs
  • src/Controls/src/Core/NavigationPage/NavigationPageToolbar.cs
  • src/Controls/src/Core/Page/Page.cs
  • src/Controls/src/Core/Picker/Picker.cs
  • src/Controls/src/Core/Platform/AlertManager/AlertManager.cs
  • src/Controls/src/Core/Platform/Android/DragAndDropGestureHandler.cs
  • src/Controls/src/Core/Platform/Android/Extensions/ToolbarExtensions.cs
  • src/Controls/src/Core/Platform/Android/GenericAnimatorListener.cs
  • src/Controls/src/Core/Platform/Android/TabbedPageManager.cs
  • src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.iOS.cs
  • src/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cs
  • src/Controls/src/Core/Platform/Windows/CollectionView/ScrollHelpers.cs
  • src/Controls/src/Core/Platform/iOS/Extensions/FormattedStringExtensions.cs
  • src/Controls/src/Core/PromptArguments.cs
  • src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt
  • src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
  • src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
  • src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
  • src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt
  • src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt
  • src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt
  • src/Controls/src/Core/RadioButton/RadioButton.cs
  • src/Controls/src/Core/ResourcesExtensions.cs
  • src/Controls/src/Core/ScrollView/ScrollView.cs
  • src/Controls/src/Core/Setter.cs
  • src/Controls/src/Core/Shell/Shell.cs
  • src/Controls/src/Core/Shell/ShellNavigationManager.cs
  • src/Controls/src/Core/Shell/ShellSection.cs
  • src/Controls/src/Core/SwipeView/SwipeItem.cs
  • src/Controls/src/Core/SwipeView/SwipeItemView.cs
  • src/Controls/src/Core/SwipeView/SwipeItems.cs
  • src/Controls/src/Core/SwipeView/SwipeView.cs
  • src/Controls/src/Core/Toolbar/Toolbar.Android.cs
  • src/Controls/src/Core/VisualElement/VisualElement.cs
  • src/Controls/src/Core/VisualStateManager.cs
  • src/Controls/src/Core/WebView/WebViewSource.cs
  • src/Controls/src/Core/Window/Window.Android.cs
  • src/Controls/src/Core/Window/Window.cs
  • src/Controls/src/SourceGen/NodeSGExtensions.cs
  • src/Core/AndroidNative/maui/src/main/java/com/microsoft/maui/PlatformWrapperView.java
  • src/Core/maps/src/Handlers/Map/MapHandler.Android.cs
  • src/Core/maps/src/Handlers/Map/MapHandler.iOS.cs
  • src/Core/maps/src/Platform/iOS/MauiMKMapView.cs
  • src/Core/src/Animations/AnimationManager.cs
  • src/Core/src/Core/IMauiRecyclerView.cs
  • src/Core/src/Core/ISafeAreaView2.cs
  • src/Core/src/Diagnostics/DiagnosticsManager.cs
  • src/Core/src/Diagnostics/IDiagnosticsManager.cs
  • src/Core/src/Diagnostics/Instrumentation/DiagnosticInstrumentation.cs
  • src/Core/src/Diagnostics/Instrumentation/LayoutArrangeInstrumentation.cs
  • src/Core/src/Diagnostics/Instrumentation/LayoutDiagnosticMetrics.cs
  • src/Core/src/Diagnostics/Instrumentation/LayoutMeasureInstrumentation.cs
  • src/Core/src/Graphics/MauiDrawable.Android.cs
  • src/Core/src/Handlers/Button/ButtonHandler.cs
  • src/Core/src/Handlers/Button/ButtonHandler.iOS.cs
  • src/Core/src/Handlers/DatePicker/DatePickerHandler.Android.cs
  • src/Core/src/Handlers/DatePicker/DatePickerHandler.MacCatalyst.cs
  • src/Core/src/Handlers/Editor/EditorHandler.iOS.cs
  • src/Core/src/Handlers/Entry/EntryHandler.cs
  • src/Core/src/Handlers/Entry/EntryHandler.iOS.cs
  • src/Core/src/Handlers/FlyoutView/FlyoutViewHandler.Android.cs
  • src/Core/src/Handlers/HybridWebView/HybridWebViewHandler.Windows.cs
  • src/Core/src/Handlers/Image/ImageHandler.Windows.cs
  • src/Core/src/Handlers/Image/ImageHandler.iOS.cs
  • src/Core/src/Handlers/Label/LabelHandler.cs
  • src/Core/src/Handlers/Label/LabelHandler.iOS.cs
  • src/Core/src/Handlers/Picker/PickerHandler.Windows.cs
  • src/Core/src/Handlers/Picker/PickerHandler.iOS.cs
  • src/Core/src/Handlers/ProgressBar/ProgressBarHandler.iOS.cs
  • src/Core/src/Handlers/RefreshView/RefreshViewHandler.Windows.cs
  • src/Core/src/Handlers/ScrollView/ScrollViewHandler.Android.cs
  • src/Core/src/Handlers/ScrollView/ScrollViewHandler.Windows.cs
  • src/Core/src/Handlers/ScrollView/ScrollViewHandler.iOS.cs
  • src/Core/src/Handlers/SearchBar/SearchBarHandler.iOS.cs
  • src/Core/src/Handlers/SearchBar/SearchBarHandler2.Android.cs
  • src/Core/src/Handlers/Stepper/StepperHandler.iOS.cs
  • src/Core/src/Handlers/SwipeItemMenuItem/SwipeItemMenuItemHandler.Android.cs
  • src/Core/src/Handlers/SwipeItemMenuItem/SwipeItemMenuItemHandler.Windows.cs
  • src/Core/src/Handlers/SwipeItemMenuItem/SwipeItemMenuItemHandler.cs
  • src/Core/src/Handlers/SwipeItemMenuItem/SwipeItemMenuItemHandler.iOS.cs
  • src/Core/src/Handlers/Switch/SwitchHandler.iOS.cs
  • src/Core/src/Handlers/View/ViewHandler.cs
  • src/Core/src/Handlers/WebView/WebViewHandler.Android.cs
  • src/Core/src/Handlers/Window/WindowHandler.Windows.cs
  • src/Core/src/Hosting/LifecycleEvents/AppHostBuilderExtensions.Android.cs
  • src/Core/src/ImageSources/FontImageSourceService/FontImageSourceService.Windows.cs
  • src/Core/src/Layouts/Flex.cs
  • src/Core/src/Platform/Android/ActivityIndicatorExtensions.cs
  • src/Core/src/Platform/Android/ActivityResultCallbackRegistry.cs
  • src/Core/src/Platform/Android/BorderDrawable.cs
  • src/Core/src/Platform/Android/ContentViewGroup.cs
  • src/Core/src/Platform/Android/EditTextExtensions.cs
  • src/Core/src/Platform/Android/LayoutViewGroup.cs
  • src/Core/src/Platform/Android/MauiAppCompatActivity.Lifecycle.cs
  • src/Core/src/Platform/Android/MauiAppCompatActivity.cs
  • src/Core/src/Platform/Android/MauiHybridWebView.cs
  • src/Core/src/Platform/Android/MauiHybridWebViewClient.cs
  • src/Core/src/Platform/Android/MauiScrollView.cs
  • src/Core/src/Platform/Android/MauiSearchView.cs
  • src/Core/src/Platform/Android/MauiSwipeRefreshLayout.cs
  • src/Core/src/Platform/Android/MauiSwipeView.cs
  • src/Core/src/Platform/Android/MauiWebView.cs
  • src/Core/src/Platform/Android/MauiWebViewClient.cs
  • src/Core/src/Platform/Android/MauiWindowInsetListener.cs
  • src/Core/src/Platform/Android/Navigation/NavigationRootManager.cs
  • src/Core/src/Platform/Android/RadioButtonExtensions.cs
  • src/Core/src/Platform/Android/SafeAreaExtensions.cs
  • src/Core/src/Platform/Android/SearchViewExtensions.cs
  • src/Core/src/Platform/Android/SemanticExtensions.cs
  • src/Core/src/Platform/Android/TextViewExtensions.cs
  • src/Core/src/Platform/Android/ViewExtensions.cs
  • src/Core/src/Platform/Android/WrapperView.cs
  • src/Core/src/Platform/Windows/ContentPanel.cs
  • src/Core/src/Platform/Windows/LayoutPanel.cs
  • src/Core/src/Platform/Windows/PickerExtensions.cs
  • src/Core/src/Platform/Windows/RadioButtonExtensions.cs
  • src/Core/src/Platform/Windows/Styles/MauiComboBoxStyle.xaml
  • src/Core/src/Platform/Windows/Styles/Resources.xaml
  • src/Core/src/Platform/Windows/TextBoxExtensions.cs
  • src/Core/src/Platform/Windows/WebViewExtensions.cs
  • src/Core/src/Platform/iOS/ButtonExtensions.cs
  • src/Core/src/Platform/iOS/KeyboardAcceleratorExtensions.cs
  • src/Core/src/Platform/iOS/MauiPageControl.cs
  • src/Core/src/Platform/iOS/MauiScrollView.cs
  • src/Core/src/Platform/iOS/MauiSwipeView.cs
  • src/Core/src/Platform/iOS/MauiTextField.cs
  • src/Core/src/Platform/iOS/MauiTextView.cs
  • src/Core/src/Platform/iOS/MauiUIApplicationDelegate.Menu.cs
  • src/Core/src/Platform/iOS/MauiView.cs
  • src/Core/src/Platform/iOS/NoCaretField.cs
  • src/Core/src/Platform/iOS/PickerExtensions.cs
  • src/Core/src/Platform/iOS/SemanticExtensions.cs
  • src/Core/src/Platform/iOS/SliderExtensions.cs
  • src/Core/src/Platform/iOS/TabbedViewExtensions.cs
  • src/Core/src/Platform/iOS/TextFieldExtensions.cs
  • src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt
  • src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
  • src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
  • src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt
  • src/Essentials/samples/Samples/View/ScreenshotPage.xaml
  • src/Essentials/src/Browser/Browser.android.cs
  • src/Essentials/src/Clipboard/Clipboard.shared.cs
  • src/Essentials/src/DeviceDisplay/DeviceDisplay.ios.cs
  • src/Essentials/src/FilePicker/FilePicker.tizen.cs
  • src/Essentials/src/MediaPicker/MediaPicker.android.cs
  • src/Essentials/src/MediaPicker/MediaPicker.tizen.cs
  • src/Essentials/src/Platform/PlatformMethods.windows.cs
  • src/Essentials/src/Screenshot/Screenshot.android.cs
  • src/Essentials/src/TextToSpeech/TextToSpeech.ios.tvos.watchos.cs
  • src/Essentials/src/TextToSpeech/TextToSpeech.shared.cs
  • src/Essentials/src/TextToSpeech/TextToSpeech.windows.cs
  • src/Essentials/src/Types/Shared/WebUtils.shared.cs
  • src/SingleProject/Resizetizer/src/GenerateTizenManifest.cs
  • src/SingleProject/Resizetizer/src/SkiaSharpSvgTools.cs
  • src/SingleProject/Resizetizer/src/nuget/buildTransitive/Microsoft.Maui.Resizetizer.After.targets
  • src/Templates/src/Microsoft.Maui.Templates.csproj
  • src/Templates/src/templates/maui-mobile/MauiApp.1.csproj

New files (not reverted):

  • eng/devices/Run-PackagedAppAndWait.ps1
  • src/Controls/src/Core/Platform/AlertManager/DelegateAlertSubscription.cs
  • src/Core/maps/src/Handlers/Map/MapElementPlatformOptions.Android.cs
  • src/Core/src/Platform/Android/AppbarLayoutExtensions.cs
  • src/Core/src/Platform/Android/IBackNavigationState.cs
  • src/Core/src/Platform/Android/RefreshViewWebViewScrollCapture.cs
  • src/Core/src/Platform/Windows/CharacterSpacingConverter.cs
  • src/Core/src/Platform/Windows/ContentPanelAutomationPeer.cs
  • src/Core/src/Platform/Windows/MauiBorderAutomationPeer.cs
  • src/Core/src/Platform/Windows/MauiLayoutAutomationPeer.cs
  • src/Core/src/Platform/iOS/MauiProgressView.cs
  • src/Templates/src/templates/maui-blazor-solution/.gitignore
  • src/Templates/src/templates/maui-blazor/.gitignore
  • src/Templates/src/templates/maui-lib/.gitignore
  • src/Templates/src/templates/maui-mobile/.gitignore
  • src/Templates/src/templates/maui-multiproject/.gitignore

UI Tests — Navigation,ViewBaseTests

Detected UI test categories: Navigation,ViewBaseTests


Pre-Flight — Context & Validation

Issue: #8680 - Rework OnBackButtonPressed to use onBackPressedDispatcher
PR: #35154 - [Android] Restore OnBackButtonPressed interception support when using OnBackPressedDispatcher
Platforms Affected: Android
Files Changed: 2 implementation, 2 test

Key Findings

  • PR replaces the Android 13+ IOnBackInvokedCallback path and removes the deprecated OnBackPressed() override, routing system back through an AndroidX OnBackPressedCallback registered with OnBackPressedDispatcher.
  • The added UI regression covers a pushed NavigationPage child whose OnBackButtonPressed() returns true and asserts exactly one system back interception.
  • Existing prior inline feedback corrected the test to Android-only compilation and to use App.Back() rather than the navigation bar back arrow.
  • GitHub CLI is unauthenticated in this environment, so PR metadata was gathered from the public GitHub API and local squashed review branch; CI checks were not queried directly.
  • Gate was already completed before this task and failed; gate verification was not re-run and gate/content.md was not modified.

Code Review Summary

Verdict: NEEDS_CHANGES
Confidence: high
Errors: 1 | Warnings: 0 | Suggestions: 0

Key code review findings:

  • src/Core/src/Platform/Android/MauiAppCompatActivity.cs: the AndroidX callback is enabled only when IBackNavigationState.CanConsumeBackNavigation is true. A root/single-page ContentPage.OnBackButtonPressed() override can still intentionally consume Android back, but with no modal or navigation stack entry CanConsumeBackNavigation is false, so the callback is disabled and the lifecycle handler is skipped. The added test only covers a pushed page and misses this regression.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #35154 Register lifecycle-aware AndroidX OnBackPressedCallback, enable it only when there is a lifecycle handler and MAUI navigation state can consume back, then fallback by temporarily disabling the callback and calling base.OnBackPressed(). ❌ FAILED (Gate pre-run) src/Core/src/Platform/Android/MauiAppCompatActivity.cs, src/Core/src/Platform/Android/MauiAppCompatActivity.Lifecycle.cs, UI test files Original PR; likely misses root-page interception.

Code Review — Deep Analysis

Code Review — PR #35154

Independent Assessment

What this changes: Replaces the Android MauiAppCompatActivity.OnBackPressed() override / native API 33 callback path with an AndroidX OnBackPressedCallback, enabling/disabling it based on whether MAUI thinks in-app back navigation can be consumed. Adds an Android UI regression test for a pushed page whose OnBackButtonPressed() returns true.
Inferred motivation: Avoid duplicate back handling on Android 13+ while preserving MAUI page/lifecycle interception and Android predictive-back behavior.

Reconciliation with PR Narrative

Author claims: The PR fixes #8680 by unifying back handling on OnBackPressedDispatcher, eliminating API 33+ dual-fire behavior, and preserving predictive back-to-home animation when the app has nothing to handle.
Agreement/disagreement: The code matches the unification goal, but the narrative is stale in places (HandleBackNavigation() is still void, and OnDestroy still does manual callback cleanup). More importantly, the implementation appears to drop valid root-page OnBackButtonPressed() interception cases.

Findings

❌ Error — Root-page back interception can be skipped

src/Core/src/Platform/Android/MauiAppCompatActivity.cs:99 enables the dispatcher callback only when IBackNavigationState.CanConsumeBackNavigation is true. For a root ContentPage or a single-page NavigationPage whose current page overrides OnBackButtonPressed() and returns true to prevent app exit, Window.CanConsumeBackNavigation(...) returns false, so the AndroidX callback remains disabled and the MAUI lifecycle/page handler is never invoked. The added test only covers a pushed page (NavigationStack.Count > 1), so it misses this regression.

⚠️ Warning — Removing the shipped OnBackPressed() override is risky

src/Core/src/Platform/Android/MauiAppCompatActivity.Lifecycle.cs:132 removes the public obsolete override while src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt still contains override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void. Even if AndroidX dispatch remains reachable through the base implementation in many cases, this is a public API/behavior compatibility change and should either keep a delegating obsolete override or be explicitly handled as an intentional API removal.

Devil's Advocate

The callback gating is trying to preserve Android's back-to-home preview, and keeping the callback always enabled may regress that animation. However, MAUI cannot infer whether arbitrary pages override OnBackButtonPressed() without invoking the existing handler path, and preserving the established interception contract is more important than silently exiting/backgrounding the app. I did not flag the base.OnBackPressed() fallback as an error because AndroidX ComponentActivity.OnBackPressed() itself dispatches through OnBackPressedDispatcher.

Verdict: NEEDS_CHANGES

Confidence: high
Summary: The PR addresses the duplicate-dispatch directionally, but it introduces a concrete regression where root/single-page OnBackButtonPressed() handlers no longer run. CI is also not green on the latest head (multiple maui-pr checks failed or were still running), so this is not ready as-is.


Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 try-fix Compatibility-first AndroidX bridge: keep shipped OnBackPressed(), replace API 33 native callback with AndroidX callback, enable when MAUI has a window/lifecycle handler. ❌ FAIL / BLOCKED 2 files Avoids RS0017 but expert review found callback is effectively always enabled because MAUI registers a built-in handler, risking predictive back-to-home suppression. HostApp test blocked by unrelated Issue7814 compile error.
2 try-fix Explicit back-consumer gating: add Controls state bridge for modal/nav/shell/flyout/root override and enable AndroidX callback only for known consumers. ❌ FAIL 5 files Fails IL2075 trim analysis due reflection; expert review found lifecycle-only handlers, custom container overrides, and Shell root cancellation are skipped.
3 try-fix Minimal duplicate-source removal: keep shipped OnBackPressed() and existing HandleBackNavigation(), remove only explicit Android 13+ native IOnBackInvokedCallback registration/unregistration/callback. ⚠️ PARTIAL PASS / UI BLOCKED 1 file Expert review clean; dotnet build src/Core/src/Core.csproj -f net10.0-android36.0 -c Debug passed. Full Android UI command blocked by unrelated HostApp Issue7814 compile error.
PR PR #35154 AndroidX dispatcher callback gated on lifecycle handler + CanConsumeBackNavigation, removes OnBackPressed(). ❌ FAILED (Gate) 4 files Gate with fix fails RS0017 because shipped public OnBackPressed() override was removed; code review also found root-page interception gap.

Cross-Pollination

Model Round New Ideas? Details
maui-expert-reviewer 1 Yes Preserve OnBackPressed() but avoid using built-in lifecycle handler presence as a proxy for app-level back consumption.
maui-expert-reviewer 2 Yes Avoid reflection/state prediction; preserve existing handler invocation and remove duplicate API 33 path instead.
maui-expert-reviewer 3 No NO NEW IDEAS: attempt 3 is the best risk/reward path; AndroidX-gated approaches need predictive state MAUI cannot reliably know ahead of dispatch and reintroduce root/lifecycle/custom-container gaps.

Exhausted: Yes
Selected Fix: Candidate #3 (provisional) — It is the only candidate with clean expert review and a passing focused Android Core build, and it directly addresses the duplicate-fire root cause while preserving shipped API and dynamic MAUI back handling. Full UI validation remains blocked by an unrelated HostApp baseline compile error in Issue7814.cs.


Report — Final Recommendation

Comparative Report — PR #35154

Winner: try-fix-3

Ranking

Rank Candidate Regression result Assessment
1 try-fix-3 ⚠️ Partial pass / UI blocked Best candidate. It removes only the duplicate Android 13+ native callback while preserving the shipped obsolete OnBackPressed() override and existing dynamic MAUI back-handler invocation. Focused Android Core build passed, expert review found no issues, and the UI block was the unrelated HostApp Issue7814 baseline compile failure.
2 pr-plus-reviewer Not fully validated Better than raw PR because reviewer feedback would preserve the shipped API, but applying the root-page feedback to the PR's AndroidX-gated approach still leaves an unsafe prediction problem: either root handlers are skipped or the callback is broadly enabled by MAUI's built-in lifecycle handler and predictive back-to-home can be suppressed.
3 pr ❌ Gate failed The submitted PR fix fails the supplied gate and has two major review findings: removal of shipped public MauiAppCompatActivity.OnBackPressed() and a root-page interception gap caused by CanConsumeBackNavigation gating.
4 try-fix-1 ❌ Fail / blocked Preserves OnBackPressed(), but expert review found the AndroidX callback becomes effectively always enabled in normal MAUI apps because of the built-in lifecycle handler, risking predictive back-to-home suppression.
5 try-fix-2 ❌ Fail Fails trim analysis (IL2075) and misses important dynamic handler cases such as lifecycle-only handlers, custom container overrides, and Shell root cancellation.

Decision

Candidates that failed regression tests are ranked below candidates that passed or were only blocked by unrelated baseline issues. try-fix-3 wins because it is the only candidate with a clean expert review and passing focused Android build, while directly addressing the duplicate back-callback root cause without removing public API or attempting brittle predictive-state modeling.

The raw PR fix should not be used as submitted. pr-plus-reviewer is not selected because the reviewer feedback exposes a deeper flaw in the PR's design rather than a small patchable issue: MAUI cannot safely precompute every dynamic consumer of Android back using CanConsumeBackNavigation.


Future Action — alternative fix proposed (try-fix-3)

Automated review — alternative fix proposed

The expert-reviewer evaluation compared the PR fix against automatically generated candidates and selected try-fix-3 as the strongest fix.

Why: try-fix-3 is the only candidate with no expert-review findings and a passing focused Android Core build. It fixes the duplicate Android 13+ native callback problem while preserving the shipped OnBackPressed API and existing dynamic MAUI back handling; the remaining UI validation block is an unrelated HostApp baseline compile issue.

Please consider applying the candidate diff below (or use it as guidance). Once you push an update, this workflow will re-trigger and re-evaluate.

Candidate diff (try-fix-3)
diff --git a/src/Core/src/Platform/Android/MauiAppCompatActivity.cs b/src/Core/src/Platform/Android/MauiAppCompatActivity.cs
index aa9b9a210e..ab24a7c1ba 100644
--- a/src/Core/src/Platform/Android/MauiAppCompatActivity.cs
+++ b/src/Core/src/Platform/Android/MauiAppCompatActivity.cs
@@ -1,7 +1,5 @@
-using System;
 using Android.OS;
 using Android.Views;
-using Android.Window;
 using AndroidX.Activity;
 using AndroidX.AppCompat.App;
 using AndroidX.Core.Content.Resources;
@@ -35,27 +33,10 @@ namespace Microsoft.Maui
 				this.CreatePlatformWindow(IPlatformApplication.Current.Application, savedInstanceState);
 			}
 
-			// Register predictive back callback (Android 13+/API 33+) if available.
-			// This integrates MAUI lifecycle OnBackPressed events with the system back gesture animation.
-			// Guidance: route custom back handling through AndroidX OnBackPressedDispatcher so
-			// predictive back works correctly:
-			// https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture#update-custom
-			if (OperatingSystem.IsAndroidVersionAtLeast(33) && _predictiveBackCallback is null)
-			{
-				_predictiveBackCallback = new PredictiveBackCallback(this);
-				// Priority 0 = PRIORITY_DEFAULT: callback invoked only when no higher-priority callback handles the event
-				OnBackInvokedDispatcher?.RegisterOnBackInvokedCallback(0, _predictiveBackCallback);
-			}
 		}
 
 		protected override void OnDestroy()
 		{
-			if (OperatingSystem.IsAndroidVersionAtLeast(33) && _predictiveBackCallback is not null)
-			{
-				OnBackInvokedDispatcher?.UnregisterOnBackInvokedCallback(_predictiveBackCallback);
-				_predictiveBackCallback.Dispose();
-				_predictiveBackCallback = null;
-			}
 			base.OnDestroy();
 		}
 
@@ -75,21 +56,5 @@ namespace Microsoft.Maui
 			return handled || implHandled;
 		}
 
-		PredictiveBackCallback? _predictiveBackCallback;
-
-		sealed class PredictiveBackCallback : Java.Lang.Object, IOnBackInvokedCallback
-		{
-			readonly MauiAppCompatActivity _activity;
-			public PredictiveBackCallback(MauiAppCompatActivity activity)
-			{
-				_activity = activity;
-			}
-
-			public void OnBackInvoked()
-			{
-				// Reuse unified handling (will invoke lifecycle events and conditionally propagate).
-				_activity.HandleBackNavigation();
-			}
-		}
 	}
 }
\ No newline at end of file

Copy link
Copy Markdown
Contributor

@kubaflo kubaflo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check the ai's suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-navigation NavigationPage community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rework OnBackButtonPressed to use onBackPressedDispatcher

8 participants